<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>layui</title>
  <meta title="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta title="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
 
  <!-- 注意：如果你直接复制所有代码到本地，上述css路径需要改成你本地的 -->
  <style>
nav a { 
text-decoration: none; 
} 
nav > div { 
float: left; 
text-align: center; 
padding: 0 0.5em; 
} 

nav div ul.sub-menu { 
display: none; 
padding-left: 0 !important; 
} 

.sub-menu li { 
color: black; 
} 

.sub-menu li:hover { 
background-color: black; 
} 

.sub-menu li:hover a { 
color: white; 
} 

ul { 
list-style: none; 
} 
  </style>
</head>
<body>

<nav><div>aaaaaaa<ul class="sub-menu"><li data-id="3" class="action-catalog_edit">编辑</li><li data-id="3" class="action-catalog_delete">删除</li></ul></div></nav>
  <script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
	 
<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
<script type="text/javascript"> 
$(document).ready(function() { 
$('nav div').hover(function() { 
$(this).find('.sub-menu').css('display', 'block'); 
}, function() { 
$(this).find('.sub-menu').css('display', 'none'); 
}); 
}); 
</script> 

</body>
</html>